<div id="control_right"  height:100%;>
 <a href="/soj/php/manager/manager_user_detail.php?name={? $username ?}">返回{? $username ?}用户管理</a>   
  {?* 大于30个结果才会使用置顶的导航栏 *?}
	{? if $results_num >= 30 ?}
	<div id="pager">
	{? $links ?}
	</div> 
  {? /if ?}
  <table bgcolor="#00CCCC">
   {? if $results_num ?}
	<caption>用户答题数 : {? $results_num ?}</caption>
    {? /if ?}
   <tr>
       {?* 为了实现灵活性，第一个foreach显示所有的标题，这样即便结果集发生了变化，模板文件也不需要修改 *?}
	<tr>
	{? if $titles|@is_array ?}
			{? foreach key=key item=title from=$titles ?}
				{? if $title eq "judge_no" ?}
					<th>No.</th>
				{? else ?}
				{? if $title eq "code_file_name" ?}
						<th>代码文件名</th>
			   {? else ?}
			   {? if $title eq "language" ?}
						
							<th>语言</th>
							
			   {? else ?}							
			   {? if $title eq "judge_time" ?}						
								<th>评测时间</th>
		       {? else ?}	
			   {? if $title eq "problem_no"?}
								   <th>题号</th>
			   {? else ?}	
			   {? if $title eq "username"?}
			  				   <th>用户名</th> 
			   {? else ?}	
			  {? if $title eq "result"?}
					          <th>结果</th>
		      {? else ?}	
			  {? if $title eq "time_spend"?}
			            	   <th>用时</th>
			  {? else ?}	
			  {? if $title eq "memory_spend"?}
								   <th>内存使用</th>
			  {? else ?}
			  <th>{? $title|replace:"_":" "|capitalize ?}</th>
							{? /if ?}	
							{? /if ?}
							{? /if ?}	
							{? /if ?}
					        {? /if ?}	
							{? /if ?}
						{? /if ?}
					{? /if ?}
				{? /if ?}
			{? /foreach ?}
		{? else ?}
			{? "error" ?}
	{? /if ?}
        <th></th><th></th>
	</tr>
{?* 设置一个指示变量,用来生成条文表格 *?}
	{? assign var=spec value=0 ?}
	{? if $results|@is_array ?}
		{? foreach key=key item=result from=$results ?}
			{? assign var=spec value=$spec+1 ?}
			
			<tr {? if $spec%2 eq 0 ?} class="spec" {? /if ?}>
				
				{? foreach key=key item=item from=$result ?}
					{? if $key eq "judge_no" ?}
						{? assign var="jno" value=$item ?}					
						<td>{? $item ?}</td>				
					{? else ?}
						{? if $key eq "code_file_name" ?}	
								{? assign var="filename" value=$item ?}								
							<td><a href="/soj/php/manager/manager_user_code_file.php?jno={? $jno ?}&username={? $username ?}&file={? $filename ?}">{? $item ?}</a></td>
						{? else ?}
							{? if $key eq "language" ?}
								<td>{? $item ?}</td>
							{? else ?}
								{? if $key eq "judge_time" ?}
									<td>{? $item|date_format:"%Y-%m-%d %H:%M:%S" ?}</td>
								{? else ?}
									{? if $key eq "problem_no" ?}										
										<td><a href="/soj/php/manager/manager_problem_detail.php?no={? $item ?}">{? $item ?}</a></td>
										{? else ?}
											{? if $key eq "username" ?}
												<td>{? $item ?}</td>
												{? else ?}
											{? if $key eq "result" ?}
												<td>{? $item ?}</td>
												{? else ?}
											{? if $key eq "time_spend" ?}
												<td>{? $item ?}</td>
												{? else ?}
											{? if $key eq "memory_spend" ?}
												<td>{? $item ?}</td>
									{? else ?}
								              
										<td>{? $item ?}</td>
												{? /if ?}
												{? /if ?}
											{? /if ?}
										{? /if ?}
									{? /if ?}
								{? /if ?}
							{? /if ?}
						{? /if ?}
					{? /if ?}					
				{? /foreach ?}			
				<td class="for manager"><a href="/soj/php/manager/manager_result_delete.php?jno={? $jno ?}&username={? $username ?}&file={? $filename ?}&op=1"  onClick="return confirm('删除记录，如果关代码的记录数位空时会连同代码删除真的要删除?')">删除</a></td>			
				</tr>
		
			{? /foreach ?}
		{? else ?}
			{? "error" ?}
	{? /if ?}
  </table> 
</div>